var vm_qushiquerenlist = new Vue({
    el: "#qushiquerenlist",
    data: {
        deptid: $("#deptid").val(),		// deptid
        olddeptid: $("#olddeptid").val(),		// deptid

        qushiquerenlist: [],// 趋势确认列表custom
        qushiquerenid: '',//去世确认id
        qushiqueren: {},//去世确认

        //查询用字段
        xingming: '',
        suoshudanwei: '',
        shenfenzhenghao: '',
        siwangbiaoji: 99,
        shifouchuli: 99,

        pageindex: 1,		// 查询分页初始化页
        pagesize: 10,		// 查询分页初始化页面大小
        pageCount: 0,		// 总页数
        recordCount: 0,	// 总记录数
        targetpage: '', 	// 目标页

    },
    created: function () {
        var _this = this;

        _this.bindQushiquerenList();

    },
    watch: {
        //监控分页情况，刷新列表
        pageindex: function () {
            this.bindQushiquerenList();
        },

        pagesize: function () {
            this.bindQushiquerenList();
        },
    },
    methods: {

        //
        bindQushiquerenList: function () {
            var _this = this;

            var zhuanjia_layer = layer.open({type: 3});
            $.post('/system/zhuanjiaqushiqueren/xiajidanweiqushilist', {
                yijidanweiid: _this.deptid,
                zhuanjiaxingming: _this.xingming,
                suoshudanwei: _this.suoshudanwei,
                shenfenzhenghao: _this.shenfenzhenghao,
                siwangbiaoji: _this.siwangbiaoji,
                shifouchuli: _this.shifouchuli,
                pageindex: _this.pageindex,
                pagesize: _this.pagesize,
                rdm: Math.random()
            }, function (ppData) {
                layer.close(zhuanjia_layer);

                if (ppData != null) {
                    var data = ppData.resultContent;

                    _this.qushiquerenlist = data.list;

                    var pageInfo = data.PageInfo;
                    _this.pageindex = pageInfo.pageIndex;
                    _this.pageCount = pageInfo.pageCount;
                    _this.recordCount = pageInfo.recordCount;
                    _this.targetpage = '';
                }
            }, "json");
        },

        //首页
        firstPage: function () {
            this.pageindex = 1;
        },
        //尾页
        lastPage: function () {
            this.pageindex = this.pageCount;
        },
        //上一页
        prePage: function () {
            var prePage = ((this.pageindex - 1) <= 0) ? 1 : (this.pageindex - 1);
            this.pageindex = prePage;
        },
        //下一页
        nextPage: function () {
            var nextPage = ((this.pageindex + 1) >= this.pageCount) ? this.pageCount : (this.pageindex + 1);
            this.pageindex = nextPage;
        },
        //跳到目标页
        targetPage: function () {
            if (this.targetpage != '' && this.targetpage <= this.pageCount && this.targetpage > 0) {
                this.pageindex = this.targetpage;
                this.targetpage = '';
            }
        },

        reset: function () {
            //查询用字段
            this.xingming = ''
            this.suoshudanwei = ''
            this.shenfenzhenghao = ''
            this.siwangbiaoji = 99
            this.shifouchuli = 99
            this.pageindex= 1
            this.pagesize= 10
            this.bindQushiquerenList()
        }

    },
})